-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make document auto-saving include the active tab index instead of just restoring the last tab #2194
base: master
Are you sure you want to change the base?
Conversation
if (!previouslySavedDocuments || !documentOrder) return; | ||
|
||
const orderedSavedDocuments = documentOrder.flatMap((id) => (previouslySavedDocuments[id] ? [previouslySavedDocuments[id]] : [])); | ||
|
||
orderedSavedDocuments?.forEach(async (doc: TriggerIndexedDbWriteDocument) => { | ||
editor.handle.openAutoSavedDocument(BigInt(doc.details.id), doc.details.name, doc.details.isSaved, doc.document); | ||
}); | ||
if (!!currentDocumentId){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The !!
is redundant here. Please also watch your formatting with there being no space between the )
and {
. Your editor must be not set up to format on autosave, so you might want to get cd frontend && npm run lint-fix
to run in your post-commit hook or format on save.
!build |
|
Only autosaved documents get serialized to the browser storage, which can get the indexes out of sync. Reproduction:
|
23a5ec0
to
addf7e8
Compare
Fixes https://discord.com/channels/731730685944922173/881073965047636018/937518022548131891